PATH_BASE = "flood/gamemode/"

local function _L( func, path, files, ignore, callback )
	files = files || "*"

	local filelist = func( ("%s%s"):format( path, files ) )
	for _, f in pairs( filelist ) do
		if ( f == "." || f == ".." || f == ".svn" ) then
				-- ignore
		elseif ( !ignore ) then
			callback( f, path );
		else
			if ( type( ignore ) == "string" && ignore != f  ) then
				callback( f, path )
			elseif ( type( ignore ) == "table" && !table.HasValue( ignore, f ) ) then
				callback( f, path );
			end
		end
	end
end

function LL( path, files, ignore, callback )
	_L( file.FindInLua, path, files, ignore, callback )
end

function L( path, files, ignore, callback )
	_L( file.Find, path, files, ignore, callback )
end

function sh_include(f)
	if SERVER then AddCSLuaFile(f) end
	include(f)
end

LL( ("%sincludes/enum/"):format( PATH_BASE ), nil, nil, function( f, p )
	sh_include( ("%s%s"):format( p, f ) )
end )
